package com.threegroup.common.utils;

import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

/**
 * 获取当前登录用户ID
 */
@Component
public class UserUtils {
    @Resource
    private HttpServletRequest request ;

    public Long getUserId(){

        return Long.parseLong(request.getAttribute("userId").toString());
    }
}
